package entity

import (
	"time"
)

// 系统日志表
type SysLog struct {
	ID             uint      `gorm:"primary_key" json:"id"`
	Method         string    `gorm:"method" json:"method"`
	Module         uint8     `gorm:"module" json:"module"`
	Content        string    `json:"content"`
	RequestUri     string    `json:"requestUri" gorm:"request_uri"`
	Ip             string    `json:"ip"`
	Province       string    `json:"province"`
	City           string    `json:"city"`
	ExecutionTime  int64     `json:"executionTime"`
	Browser        string    `json:"browser" gorm:"column:browser"`
	BrowserVersion string    `json:"browserVersion" gorm:"column:browser_version"`
	Os             string    `json:"os"`
	CreateBy       uint      `json:"createBy" gorm:"create_by"`
	CreateTime     time.Time `json:"createTime" gorm:"column:create_time;type:datetime;autoCreateTime"`
	IsDeleted      uint8     `json:"isDeleted" gorm:"is_deleted"`
}

func (SysLog) TableName() string {
	return "sys_log"
}

type LogPageQuery struct {
	PageQuery PageQuery
	StartDate *string `json:"startDate" form:"startDate"`
	EndDate   *string `json:"endDate" form:"endDate"`
}

type LogPage struct {
	ID            uint      `gorm:"primary_key" json:"id"`
	Module        string    `gorm:"module" json:"module"`
	Content       string    `json:"content"`
	RequestUri    string    `json:"requestUri" gorm:"request_uri"`
	Method        string    `json:"method" gorm:"method"`
	Ip            string    `json:"ip"`
	Region        string    `json:"region"`
	Browser       string    `json:"browser" gorm:"column:browser"`
	Os            string    `json:"os"`
	ExecutionTime int64     `json:"executionTime"`
	CreateBy      uint      `json:"createBy" gorm:"create_by"`
	CreateTime    time.Time `json:"createTime" gorm:"column:create_time;type:datetime;autoCreateTime"`
	Operator      string    `json:"operator"`
}
type LogPageVO struct {
	ID            uint   `gorm:"primary_key" json:"id"`
	Module        string `gorm:"module" json:"module"`
	Content       string `json:"content"`
	RequestUri    string `json:"requestUri" gorm:"request_uri"`
	Method        string `json:"method" gorm:"method"`
	Ip            string `json:"ip"`
	Region        string `json:"region"`
	Browser       string `json:"browser" gorm:"column:browser"`
	Os            string `json:"os"`
	ExecutionTime int64  `json:"executionTime"`
	CreateBy      uint   `json:"createBy" gorm:"create_by"`
	CreateTime    string `json:"createTime" gorm:"column:create_time;type:datetime;autoCreateTime"`
	Operator      string `json:"operator"`
}
